<?php

	$curl = curl_init();
	
	curl_setopt($curl, CURLOPT_URL, 'http://www.fancai.com/Image/MeiShi/2011-05-03/2011050309224841120651788.jpg');
	//curl_setopt($curl, CURLOPT_URL, 'http://www.chinacaipu.com');
	curl_setopt($curl, CURLOPT_HEADER, 1);
	//curl_setopt($curl, CURLOPT_RETURNTRANSFER, 0);
	
	$useragent="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; QQDownload 1.7; TencentTraveler 4.0"; 
	curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
	//curl_setopt($ch, CURLOPT_REFERER, 'http://www.fancai.com'); 
	//curl_setopt($ch,CURLOPT_COOKIESESSION,true);
	//curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1); 
	
	$data = curl_exec($curl);
	
	curl_close($curl);  
	
	//var_dump($data);
	
	$targetFile = "/home/dragon/small_28150.jpg";
	$targetfp = fopen($targetFile, "a");
	fwrite($targetfp, $data);
	fclose($targetfp);
	
?>